<html>

<head>
<title>Update</title>
<link type="text/css" href="jquery-ui-1.8.13.custom/css/smoothness/jquery-ui-1.8.13.custom.css" rel="Stylesheet" />	
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.13.custom/js/jquery-ui-1.8.13.custom.min.js"></script>
</head>
<body>
    
     <script language="javascript">
function fncSubmit()
{
if(document.form1.stf_id.value == "")
	{
	alert('Please input STAFF_ID');
		document.form1.stf_id.focus();
		return false;
	}
if(document.form1.f_name.value == "")
	{
		alert('Please input NAME');
		document.form1.f_name.focus();
		return false;
	}
  
if(document.form1.l_name.value == "")
	{
		alert('Please input SURNAME');
		document.form1.l_name.focus();       
		return false;
	}	  
if(document.form1.job_type.value == "")
	{
		alert('Please input JOB-TYPE');
		document.form1.job_type.focus();       
		return false;
	}	
if(document.form1.salary.value == "")
	{
		alert('Please input SALARY');
		document.form1.salary.focus();       
		return false;
	}
if(document.form1.startcontract.value == "")
	{
		alert('Please input START-CONTRACT');
		document.form1.startcontract.focus();       
		return false;
	}
if(document.form1.endcontract.value == "")
	{
		alert('Please input END-CONTRACT');
		document.form1.endcontract.focus();       
		return false;
	}
	document.form1.submit();
}

</script>

<br/>
<br/>
<center><h1>Update FINANCE</h1></center>
<br/>
<center><table border=3 bordercolor="#ff99cc">
<tr><td>

<?
	$conn = oci_connect("hospital", "hospital", "//localhost/XE"); 
	$call = "select * from STAFF where stf_id = '".$_GET["ids"]."' ";
	$col = $_GET["ids"];
        
	$pull = oci_parse($conn,$call);
	oci_execute($pull,OCI_DEFAULT);
	$total = oci_fetch_array($pull);
?>
<form action="edit-finance.php?col=+<?echo $col?>" method="post" name="form1" onSubmit="JavaScript:return fncSubmit();">
	STAFF_ID: <input type="text" name="stf_id" value = "<?=$total["STF_ID"];?>" /><br/>
        
	NAME: <input type="text" name="f_name" value = "<?=$total["F_NAME"];?>"/><br/>
        
	SURNAME: <input type="text" name="l_name" value = "<?=$total["L_NAME"];?>"/><br/>
        
        JOB_TYPE:<select name="job_type" value = "<?=$total["JOB_TYPE"];?>"  onchange="populate(this)"/>
			<option value='FIN'>FINANCE</option>
                </select><br/>
                        
        SALARY: <input type="text" name="salary" value = "<?=$total["SALARY"];?>"/><br/>
        
        START-CONTRACT: <input type="text" name="startcontract" id="datepicker" value = "<?=$total["START_CONTACT"];?>"/><br/>
	END-CONTRACT: <input type="text" name="endcontract" id="datepicker2" value = "<?=$total["END_CONTACT"];?>"/><br/>
<p>Format options:
	<select id="format">
		<option value="dd/mm/yy">Default - dd/mm/yy</option>
		<option value="dd-M-yy">ISO 8601 - dd-M-yy</option>
	</select>
</p>
	

	<center><input type="submit" /></center>
	
</form>

</td></tr>
</table>

<script>
	$(function() {
		$( "#datepicker" ).datepicker();
		$( "#format" ).change(function() {
			$( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() );
		});
	});
        $(function() {
		$( "#datepicker2" ).datepicker();
		$( "#format" ).change(function() {
			$( "#datepicker2" ).datepicker( "option", "dateFormat", $( this ).val() );
		});
	});
</script>


</body>
</html>
